import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '创建人',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '参赛人姓名',
    align:"center",
    dataIndex: 'cansrxm'
   },
   {
    title: '参赛人性别',
    align:"center",
    dataIndex: 'cansrxb_dictText'
   },
   {
    title: '证件类型',
    align:"center",
    dataIndex: 'zhengjlx_dictText'
   },
   {
    title: '证件号码',
    align:"center",
    dataIndex: 'zhengjhm'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'lianxdh'
   },
   {
    title: '邮箱',
    align:"center",
    dataIndex: 'youx'
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'danwmc'
   },
   {
    title: '属地',
    align:"center",
    dataIndex: 'shud'
   },
   {
    title: '详细地址',
    align:"center",
    dataIndex: 'xiangxdz'
   },
   {
    title: '其他参赛人姓名',
    align:"center",
    dataIndex: 'qitcsrxm'
   },
   {
    title: 'qq',
    align:"center",
    dataIndex: 'qq'
   },
   {
    title: '微信',
    align:"center",
    dataIndex: 'wechat'
   },
   {
    title: '擅长领域',
    align:"center",
    dataIndex: 'shanchang'
   },
   {
    title: '个人高清照片',
    align:"center",
    dataIndex: 'gerzp',
    customRender:render.renderImage,
   },
   {
    title: '证件照片',
    align:"center",
    dataIndex: 'zengjzp',
    customRender:render.renderImage,
   },
   {
    title: '个人荣誉证书',
    align:"center",
    dataIndex: 'gershqtryzs',
    customRender:render.renderImage,
   },
   {
    title: '个人简介',
    align:"center",
    dataIndex: 'jianj',
    customRender:render.renderImage,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "参赛人姓名",
      field: 'cansrxm',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "参赛人性别",
      field: 'cansrxb',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"sex"
      },
      //colProps: {span: 6},
 	},
	{
      label: "证件类型",
      field: 'zhengjlx',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"zhengjlx"
      },
      //colProps: {span: 6},
 	},
	{
      label: "证件号码",
      field: 'zhengjhm',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "联系电话",
      field: 'lianxdh',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "邮箱",
      field: 'youx',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '参赛人姓名',
    field: 'cansrxm',
    component: 'Input',
  },
  {
    label: '参赛人性别',
    field: 'cansrxb',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sex"
     },
  },
  {
    label: '证件类型',
    field: 'zhengjlx',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zhengjlx"
     },
  },
  {
    label: '证件号码',
    field: 'zhengjhm',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'lianxdh',
    component: 'Input',
  },
  {
    label: '邮箱',
    field: 'youx',
    component: 'Input',
  },
  {
    label: '单位',
    field: 'danwmc',
    component: 'Input',
  },
  {
    label: '属地',
    field: 'shud',
    component: 'Input',
  },
  {
    label: '详细地址',
    field: 'xiangxdz',
    component: 'InputTextArea',
  },
  {
    label: '其他参赛人姓名',
    field: 'qitcsrxm',
    component: 'Input',
  },
  {
    label: 'qq',
    field: 'qq',
    component: 'Input',
  },
  {
    label: '微信',
    field: 'wechat',
    component: 'Input',
  },
  {
    label: '擅长领域',
    field: 'shanchang',
    component: 'InputTextArea',
  },
  {
    label: '个人高清照片',
    field: 'gerzp',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '证件照片',
    field: 'zengjzp',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '个人荣誉证书',
    field: 'gershqtryzs',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '个人简介',
    field: 'jianj',
     component: 'JImageUpload',
     componentProps:{
      },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createBy: {title: '创建人',order: 0,view: 'text', type: 'string',},
  cansrxm: {title: '参赛人姓名',order: 1,view: 'text', type: 'string',},
  cansrxb: {title: '参赛人性别',order: 2,view: 'list', type: 'string',dictCode: 'sex',},
  zhengjlx: {title: '证件类型',order: 3,view: 'list', type: 'string',dictCode: 'zhengjlx',},
  zhengjhm: {title: '证件号码',order: 4,view: 'text', type: 'string',},
  lianxdh: {title: '联系电话',order: 5,view: 'text', type: 'string',},
  youx: {title: '邮箱',order: 6,view: 'text', type: 'string',},
  danwmc: {title: '单位',order: 7,view: 'text', type: 'string',},
  shud: {title: '属地',order: 8,view: 'text', type: 'string',},
  xiangxdz: {title: '详细地址',order: 9,view: 'textarea', type: 'string',},
  qitcsrxm: {title: '其他参赛人姓名',order: 10,view: 'text', type: 'string',},
  qq: {title: 'qq',order: 11,view: 'text', type: 'string',},
  wechat: {title: '微信',order: 12,view: 'text', type: 'string',},
  shanchang: {title: '擅长领域',order: 13,view: 'textarea', type: 'string',},
  gerzp: {title: '个人高清照片',order: 14,view: 'image', type: 'string',},
  zengjzp: {title: '证件照片',order: 15,view: 'image', type: 'string',},
  gershqtryzs: {title: '个人荣誉证书',order: 16,view: 'image', type: 'string',},
  jianj: {title: '个人简介',order: 17,view: 'image', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}